<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'${button.icon!}',plain:true"
onclick="QRcode_img_export()">
  ${button.name!}
</a>
<script type="text/javascript">
var QRcode_img_export = function() {
    var $grid = $('#${gridId}');
    var rows = $grid.datagrid('getSelections');
    var num = rows.length;
    if (num == "0") {
      $.slideMsg("请至少选择一条记录！");
        return;
    }
    var vals = [];
    for (var i = 0; i < rows.length; i++) { //组成一个字符串，ID主键用逗号隔开
      vals.push(rows[i]['qrcode_img']);
    }
    var qrcode_img = vals[0];
    var protocol = window.location.protocol;
    var host = window.location.host;
    var port = window.location.port;
    var img_url = protocol+"//"+host+"/upimg/"+qrcode_img;
    //alert("!@#*********"+'../../upimg/'+qrcode_img);
    alert(img_url);
    DownLoadReportIMG(img_url);
};

function DownLoadReportIMG(imgPathURL) {
    //如果隐藏IFRAME不存在，则添加
    if (!document.getElementById("IframeReportImg"))
        $('<iframe style="display:none;" id="IframeReportImg" name="IframeReportImg" onload="DoSaveAsIMG();" width="0" height="0" src="about:blank"></iframe>').appendTo("body");
    if (document.all.IframeReportImg.src != imgPathURL) {
        //加载图片
        document.all.IframeReportImg.src = imgPathURL;
        //DoSaveAsIMG();
    }
    else {
        //图片直接另存为
        DoSaveAsIMG();
    }
}
function DoSaveAsIMG() {
    if (document.all.IframeReportImg.src != "about:blank")
        window.frames["IframeReportImg"].document.execCommand("SaveAs");
}
//判断是否为ie浏览器
function browserIsIe() {
    if (!!window.ActiveXObject || "ActiveXObject" in window)
        return true;
    else
        return false;
}

</script>